import {combineReducers, createStore} from 'redux'
import thunk from 'redux-thunk'
import {applyMiddleware}  from 'redux'
import countReducer from './reducers/countReducer'
import zanReducer from './reducers/zanReducer'

let reducer=combineReducers({
  count:countReducer,
  zan:zanReducer
})


let store=createStore(reducer,applyMiddleware(thunk))

// store.subscribe(()=>{
//   console.log('状态已经改变了');
// })


export default store


// console.log(store.getState());

// store.dispatch({type:'add',payload:40})
// store.dispatch({type:'sub',payload:20})
// store.dispatch({type:'chen',payload:5})

// console.log(store.getState());